package com.fanqiechaodan.responsibilitychain;

/**
 * @author fanqiechaodan
 * @Classname ConcreteHandlerA
 * @Description 具体的处理类A
 */
public class ConcreteHandlerA extends Handler {

    /**
     * 处理请求的方法
     *
     * @param request
     */
    @Override
    public void handle(Request request) {
        if (request.getRequestType() == RequestType.TYPE_A) {
            // 处理请求
            System.out.println("ConcreteHandlerA 处理了请求:" + request.getContent());
        }else {
            // 将请求传递给下一个处理器
            if (nextHandler != null){
                nextHandler.handle(request);
            }
        }
    }
}
